/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.user.edituser;

import assignment_cp3120.user.registeruser.RegisterUserView;
import assignment_cp3120.ucm.UC2AL;
import assignment_cp3120.ucm.UCEditUser;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author Administrator
 */
public class EditUserView extends RegisterUserView{
    private EditUserModel model;

    public EditUserView() {
        this(new EditUserModel());
    }
    public EditUserView(EditUserModel model) {
        this.model = model;
        super.clearButtonAL();
        setButtonAL();
    }
    
    private CancelButtonAL c = new CancelButtonAL();
    private UC2AL s = new UC2AL(new UCEditUser(model,this));
    @Override protected void clearButtonAL() {
        cancelButton.removeActionListener(c);
        submitButton.removeActionListener(s);
    }
    @Override protected void setButtonAL() {
        cancelButton.addActionListener(c);
        submitButton.addActionListener(s);
    }
    private class CancelButtonAL implements ActionListener{
        public void actionPerformed(ActionEvent e) {
            hideGUI();
        }        
    }
}
